/**
 * ITmCustomService.java
 * Created at 2017-2-8
 * Created by xieshuang
 * Copyright (C) 2017 BROADTEXT SOFTWARE, All rights reserved.
 */
package com.broadtext.rms.basic.service;

import java.util.List;
import java.util.Map;

import com.broadtext.common.bean.EntityPageBean;
import com.broadtext.common.exp.DaoException;
import com.broadtext.common.exp.ServiceException;
import com.broadtext.common.service.IEntityService;
import com.broadtext.rms.basic.model.TmCustom;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;

/**
 * <p>ClassName: ITmCustomService</p>
 * <p>Description: 客户服务层接口</p>
 * <p>Author: xieshuang</p>
 * <p>Date: 2017-2-8</p>
 */
public interface ITmCustomService extends IEntityService<TmCustom> {

    /**
     * 
     * <p>Description: 批量删除 </p>
     * @param idArray 主键数组
     * @param currentUser 当前用户
     * @throws DaoException 异常
     */
    void delete(String[] idArray, String currentUser) throws DaoException;

    /**
     * 
     * <p>Description: 客户字典查询</p>
     * @param queryMap 查询条件
     * @return 客户字典
     * @throws DaoException 异常
     */
    List<Map<String, String>> getCustomDict(Map<String, Object> queryMap) throws DaoException;

    /**
     * 
     * <p>Description: 根据id获取客户对象</p>
     * @param id 主键id
     * @return 客户对象
     * @throws DaoException 异常
     */
    TmCustom findCustomerById(String id) throws DaoException;

    /**
     * 
     * <p>Description: 检查待删除客户状态是否合法</p>
     * @param ids id数组
     * @return 检查结果
     * @throws DaoException 异常
     */
    Object checkCustomerStatus(String[] ids) throws DaoException;

    /**
     * 
     * <p>Description: 查询客户简称列表</p>
     * @return 客户
     * @throws ServiceException 异常
     */
    List<Object> getCustomerShortNames() throws ServiceException;
    
    /**
     * 
     * <p>Description:查询上级客户</p>
     * @return 客户
     * @throws ServiceException 异常
     */
    List<Object> getParentCusOption(String parentId, String operation) throws ServiceException;
    
    /**
     * 
     * <p>Description: 根据根节点获取子节点pk_id 数组</p>
     * @param rootId
     * @return
     * @throws ServiceException
     */
    List<String> getChildCusIdArray(String rootId) throws ServiceException; 
    
    /**
     * 
     * <p>Description: 编辑客户时获取上级可选单位去除客户本身</p>
     * @param rootId 登录人pk_id 根节点id，根据此id获取客户树形结构数据
     * @param cusId 需要编辑的用户pk_id,选上级单位时不能选自己作为自己的上级单位。除去此项
     * @return
     * @throws ServiceException
     */
     List<Object> getParentCusOptionExcludeSelf(String rootId,String cusId) throws ServiceException;
     
     /**
      * 
      * <p>Description: 客户下拉框分页查询</p>
      * @param params 查询条件
      * @param pageBounds 分页
      * @return 结果集
      * @throws DaoException 异常
      */
     EntityPageBean<TmCustom> getCustomerOptions(Map<String, Object> params,
             PageBounds pageBounds) throws ServiceException;
     
     /**
      * 
      * <p>Description: 查询客户关联电池</p>
      * @param id
      * @return
      * @throws ServiceException
      */
     Map<String, Object> initBatteryCorrelation(String id) ;
     
     /**
      * 
      * <p>Description: 保存关联电池信息</p>
      * @param pkId 客户id
      * @param packCode 电池id
      * @param loginUser 登录用户
      */
     void saveBatteryCorrelation(String pkId, String packCode, String packCodeNot);
}
